package com.wc.alorithm_luogu.P1055;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/19 13:30
 * @description https://www.luogu.com.cn/problem/P1055
 * ISBN 号码
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String[] split = sc.nextLine().split("-");
        int sum = 0;

        // 1位置
        sum += Integer.parseInt(split[0]);

        // 2位置
        sum += Integer.parseInt(split[1].charAt(0) + "") * 2;
        // 3位置
        sum += Integer.parseInt(split[1].charAt(1) + "") * 3;
        // 4位置
        sum += Integer.parseInt(split[1].charAt(2) + "") * 4;

        for (int i = 0; i < split[2].length(); i++) {
            sum += Integer.parseInt(split[2].charAt(i) + "") * (i + 5);
        }

        String next;
        if (sum % 11 == 10) {
            if ("X".equals(split[3])) {
                System.out.println("Right");
                return;
            }
            next = "X";
        } else {
            next = sum % 11 + "";
            if (next.equals(split[3])) {
                System.out.println("Right");
                return;
            }
        }
        split[3] = next;
        String join = String.join("-", split);

        System.out.println(join);
    }
}
